<!--
 * @Description  : 内容页 头部标题 
 * @Author       : zhao
 * @Date         : 2022-06-28 11:16:18
 * @LastEditors  : zhao
 * @LastEditTime : 2022-11-01 13:52:11
-->

<template>
	<div class="title" v-if="name">
		<div class="pwd_top">
			<i :class="icon" v-if="url" @click="backs(url)" class="cursor"></i>
			<span>{{ name }}</span>
		</div>
	</div>
</template>

<script>
export default {
	name: '',
	components: {},
	props: {
		name: String,
		icon: {
			type: String,
			default: 'el-icon-back',
		},
		url: String,
	},
	data() {
		return {};
	},

	computed: {},

	mounted() {},

	methods: {
		backs(url) {
			// const router = this.$route.path;
			// let paths = router.split('/');
			// paths.shift();
			// paths.pop();
			// let pa = '';
			// paths.map((e) => {
			// 	pa += '/' + e;
			// });
			this.$router.push({ path: url });
		},
	},
};
</script>
<style lang='scss' scoped>
.title {
	// padding-bottom: 10px;
}

.pwd_top {
	padding: 0 0px;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	background: #ebf5ff !important;
	border-radius: 5px 5px 0 0;

	span {
		text-decoration: none;
		color: #409eff !important;
		font-size: 20px;
		font-weight: 600;
		font-family: ' 微软雅黑';
		padding: 10px;
	}

	i {
		padding-left: 10px;
		color: #409eff !important;
		font-size: 30px;
	}
}
</style>
